package com.guofen.dao;

import com.guofen.pojo.Earthquake;
import com.guofen.pojo.Name;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EarthquakeMapper {
    List<Earthquake> selectAll();

    Earthquake selectByPrimaryKey(String id);

    int deleteByPrimaryKey(String id);

    int insertSelective(Earthquake earthquake);

    int updateByPrimaryKeySelective(Earthquake earthquake);

    List<Earthquake> selectByMag(@Param("lowMag")Double lowMag,
                                 @Param("highMag")Double highMag);

    int selectMagCount(@Param("lowMag")Double lowMag,
                       @Param("highMag")Double highMag,
                       @Param("limit")Integer limit);

    int selectDepthCount(@Param("lowDepth")Double lowDepth,
                         @Param("highDepth")Double highDepth,
                         @Param("limit")Integer limit);

    List<Earthquake> selectByDate(@Param("startDate")String startDate,
                                  @Param("endDate")String endDate);

    List<Earthquake> selectByDateAndMag(@Param("lowMag")Double lowMag,
                                        @Param("highMag")Double highMag,
                                        @Param("startDate")String startDate,
                                        @Param("endDate")String endDate);

    List<Earthquake> selectByDistance(@Param("lat")Double lat,
                                      @Param("lon")Double lon,
                                      @Param("distance")Double distance);

    List<Earthquake> selectByDistanceAndMag(@Param("lat")Double lat,
                                            @Param("lon")Double lon,
                                            @Param("distance")Double distance,
                                            @Param("lowMag")Double lowMag,
                                            @Param("highMag")Double highMag);

    List<Earthquake> selectByTime(@Param("startTime")String startTime,
                                  @Param("endTime")String endTime);

    List<Earthquake> selectByTimeAndMag(@Param("lowMag")Double lowMag,
                                        @Param("highMag")Double highMag,
                                        @Param("startTime")String startTime,
                                        @Param("endTime")String endTime);

    List<Earthquake> selectByPlace(String place);
}
